#ifndef _FLUIDPROPS_H_
#define _FLUIDPROPS_H_
#include "config.hpp"
#include "defs.h"
// #include "geometry.h"
// 没考虑内流
class Fluid
{
private:
  VarArray<ConsVar_t, 2, 0> cv;
  VarArray<DeptVarE_t, 2, 0> dvE;
  VarArray<DeptVarNS_t, 2, 0> dvNS;
  VarArray<real_t, 2, 0> press;

  const Equation_t equsType;
  const bool isRestart;
  const Nondim_t nondimType;
  const real_t reNum, mach, aoa, Tinf_d, reLen;
  // 来流有量纲量
  real_t uInf_d, vInf_d, pInf_d, rhoInf_d, muInf_d, velInf_d, dynamicPress;
  // 长度参考量为 1
  const real_t Lref{1.0}, reRef{1.0};
  real_t velRef, Tref, rhoRef, pRef, timeRef, muRef;

  // 下面用于输出的转换
  real_t tauRef, eRef, hRef, kaRef;
  real_t Rref, cpRef, cvRef;

  // 无量纲量
  // real_t rgas_nd{}, cpgas_nd{}, cvgas_nd{};
  // real_t velInf_nd, uInf_nd, vInf_nd, Tinf_nd, pInf_nd, rhoInf_nd, muInf_nd;

  const int imax, jmax;
  // sutherland
  real_t SmuRef_d{1.716E-5}, STref_d{273.15}, Sconst_d{110.4};
  // SmuRef_nd,
  //     STref_nd, Sconst_nd;
  real_t uInf, vInf, velInf, rhoInf, pInf, Tinf, cpgas, rgas,
      sutMu, sutT0, sutTs, muInf;

public:
  Fluid() = default;
  Fluid(const Fluid &src) = delete;
  Fluid(Fluid &&src) = delete;
  Fluid &operator=(const Fluid &src) = delete;
  Fluid &operator=(Fluid &&src) = delete;

  VarArray<ConsVar_t, 2, 0> &GetCV(void) { return cv; }
  VarArray<DeptVarE_t, 2, 0> &GetdvEuler(void) { return dvE; }
  VarArray<DeptVarNS_t, 2, 0> &GetdvNS(void) { return dvNS; }
  VarArray<real_t, 2, 0> &GetPressure(void) { return press; }

  const VarArray<ConsVar_t, 2, 0> &GetCV(void) const { return cv; }
  const VarArray<DeptVarE_t, 2, 0> &GetdvEuler(void) const { return dvE; }
  const VarArray<DeptVarNS_t, 2, 0> &GetdvNS(void) const { return dvNS; }
  const VarArray<real_t, 2, 0> &GetPressure(void) const { return press; }

  real_t GetuInf(void) const { return uInf; }
  real_t GetvInf(void) const { return vInf; }
  real_t GetVelInf(void) const { return velInf; }
  real_t GetRhoInf(void) const { return rhoInf; }
  real_t GetpInf(void) const { return pInf; }
  real_t GetTinf(void) const { return Tinf; }
  real_t GetRgas(void) const { return rgas; }
  real_t GetDynamicPress(void) const { return dynamicPress; }

  real_t GetMuInf(void) const { return muInf; }
  real_t GetSutherlandMuref(void) { return sutMu; }
  real_t GetSutherlandTref(void) { return sutT0; }
  real_t GetSutherlandTs(void) { return sutTs; }
  Fluid(const Config &cfg, int imax, int jmax);
  void InitFlow();
  // void DependentVarsOne(int i, int j);

  void PrintEuler(void) const;
  void PrintNS(void) const;
  void DependentVarsAllEuler(void);
  void DependVarsAllNS(void);
};

#endif